{% extends "report/report.html" %}


{% block report %}
  {% for metric in report.metrics %}
    {% if metric[viz]['enabled'] %}
      <section id="{{ metric.id }}" class="report-metric">
        {{ metric_info(metric, viz) }}
        <div id="{{ metric.id }}-chart" class="chart"></div>
        <button class="btn show-hide" data-metric="{{ metric.id }}">Show Table</button>
        <div class="table-wrapper">
          <table id="{{ metric.id }}-table" class="table hidden"></table>
        </div>
      </section>
    {% endif %}
  {% endfor %}
{% endblock %}

{% block scripts %}
  {{ super() }}
  <script src="{{ get_versioned_filename('/static/js/highcharts-more.js') }}"></script>
  <script src="{{ get_versioned_filename('/static/js/timeseries.js') }}"></script>
  <script nonce="{{ csp_nonce() }}">
{% for metric in report.metrics %}
  {% if metric[viz]['enabled'] %}
    timeseries({{ metric.id|tojson }},
      {{ metric|tojson }},
      {{ start|tojson }},
      {{ end|tojson }});
  {% endif %}
{% endfor %}
  </script>
{% endblock %}
